﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Documentation_CRUD_ClientSide" Codebehind="ClientSide.aspx.cs" %>

<%@ Register Assembly="Pampa.CRUD" Namespace="Pampa.CRUD.UI.CustomControls" TagPrefix="cc1" %>

<%@ Register Assembly="Pampa.CRUD" Namespace="Pampa.WebControls" TagPrefix="cc2" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Página sin título</title>
    <link href="../../Css/Layout.css" rel="stylesheet" type="text/css"/>           
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <span class="title">Client Side</span>       
        <br />         
        <br />
        Talk with the entity edit component in the client side it is possible to manage its behavior without refresh the page.
        It includes: shows and hide groups of items, get and set values, enable and disable groups and items, get the control associated to a property, etc. 
        <br />
        <br />
        <br />
                
        <span class="subtitle">Entity Edit</span>      
        <br />
        <br />
        In EntityEdit.js there are defined a couple of functions for controlling the entity edit component in the client side. 
        All these methods could be seen as static due to they receive the id of the entity edit control we want to talk with. 
        <br />
        <br />
        <br />
                
        <span class="subsubtitle">EntityEdit_SaveState(id)</span>    
        <br />
        Save the state of the current edition updating the properties of the entity associated to the control 
        (the entity is saved in the web session). It is useful when we want to go to another page an then continue editing.
        Validations will not be accounted for and all the errors produced when the entity is updated will be ignored.
        <br />
        <br />
                
        <span class="subsubtitle">EntityEdit_ValidateAndSave(id)</span> 
        <br />
        Validate and save the entity associated to the control. 
        It is the same method called by the SaveButton.
        <br />
        <br />
                
        <span class="subsubtitle">EntityEdit_Validate(id)</span> 
        <br />
        Validate the content of the edition without save the entity.
        <br />
        <br />
                
        <span class="subsubtitle">EntityEdit_GetEntityId(id)</span> 
        <br />
        Return the id of the entity associated to the control.
        <br />
        <br />
                
        <span class="subsubtitle">EntityEdit_GetGroup(id, idgroup)</span> 
        <br />
        Return the group with id = idgroup.
        <br />
        <br />
                
        <span class="subsubtitle">EntityEdit_ShowGroup(id, idgroup)</span> 
        <br />
        Show the group with id = idgroup.
        <br />
        <br />
                
        <span class="subsubtitle">EntityEdit_HideGroup(id, idgroup)</span> 
        <br />
        Hide the group with id = idgroup.
        <br />
        <br />        
        <br />

        <span class="subtitle">Editable Group</span>      
        <br />
        <br />
        Function EntityEdit_GetGroup return an instance of EditableGroup class. 
        ...
        <br />
        <br />
        <br />
        
        <span class="subsubtitle">group.disable()</span>
        <br />
        Disable the group turning all the fields inside the group as readonly.
        <br />
        <br />           
        
        <span class="subsubtitle">group.enable()</span>
        <br />
        Enable the edition of all fields inside the group (fields that are allowed to edit following the security rules. See <a href="SecurityManager.aspx">SecurityManager</a>).
        <br />
        <br />   
                
        <span class="subsubtitle">group.enableItem(itemID)</span>
        <br />
        Enable the item with id = itemID.
        <br />
        <br />   
                
        <span class="subsubtitle">group.disableItem(itemID)</span>
        <br />
        Disable the item with id = itemID.
        <br />
        <br />   
                
        <span class="subsubtitle">group.getControl(itemID)</span>
        <br />
        Return the edition control corresponding to item with id = itemID
        <br />
        <br />           
        
        <span class="subsubtitle">group.getValue(itemID)</span>
        <br />
        Return the value of item with id = itemID
        <br />
        <br />   
                
        <span class="subsubtitle">group.setValue(itemID, value)</span>
        <br />
        Set the value of item with id = itemID
        <br />
        <br />   
                
        <span class="subsubtitle">group.getDescription(itemID)</span>
        <br />
        Return the description of item with id = itemID. 
        It works just with EntitySelector items which has a value an a description (see <a href="EntityControls.aspx">Entity Controls</a>).
        <br />
        <br />   
                
        <span class="subsubtitle">group.setDescription(itemID, value)</span>
        <br />
        Set the description of item with id = itemID. 
        It works just with EntitySelector (idem getDescription)
        <br />
        <br />           
        
        <span class="subsubtitle">group.getRowID(index)</span>
        <br />
        Return the id of a row in a Repetitive Group. If the group is not a repetitive group this function is not available.
        <br />
        <br />   
        
    </div>
    </form>
</body>
</html>
